package day10.Map;

/*
 * Author: JacksonCoder
 * FileName: LinkedHashMapDemo
 * Version: 1.0.0
 * Date: 2025/4/17
 */

import java.util.LinkedHashMap;

public class LinkedHashMapDemo {

    public static void main(String[] args) {
        LinkedHashMap<String, Integer> map = new LinkedHashMap<>();

        // 添加元素
        map.put("Java", 1);
        map.put("Python", 2);
        map.put("C++", 3);

        // 遍历
        for (String key : map.keySet()) {
            System.out.println(key + " = " + map.get(key));
        } // 输出顺序：Java, Python, C++



    }

}
